package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.House;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface HouseDao {

    @Insert("insert into house(goodsId,hotelId,goodsName,houseIntroduction,insertTime,updateTime,status,price,discount,discountPrice,tags,superDiscount,houseDesc) " +
            "values(#{goodsId},#{hotelId},#{goodsName},#{houseIntroduction},#{insertTime},#{updateTime},#{status},#{price},#{discount},#{discountPrice},#{tags},#{superDiscount},#{houseDesc})")
    int insert(House house);

    @Select("select * from house")
    List<House> query();

    @Select("select * from house where goodsId=#{goodsId}")
    House queryById(String goodsId);

    @Select("select * from house where hotelId=#{hotelId}")
    List<House> queryByHotel(String hotelId);
}
